<template>
  <mt-swipe :show-indicators="false" :stopPropagation="true">
    <mt-swipe-item v-for="(item, index) in data" :key="index">
      <img :src="item.url" @click="chosen(item.href)"/>
    </mt-swipe-item>
  </mt-swipe>
</template>

<script lang="ts">
import { Component, Vue, Prop } from 'vue-property-decorator';
import { ISwiper } from '../../../modules/index';
@Component
export default class TopSearch extends Vue {
  // 轮播图所需要数据
  @Prop() private data!: ISwiper[];
  /**
   * 点击图片跳转到对应的展示页面
   */
  private chosen(href: string) {
    console.log('href', href);
  }
}
</script>

<style lang="scss" scoped>
img {
  width: 100%;
}
</style>
